|
In compiler theory, live variable analysis (or simply liveness analysis) is a classic data-flow analysis performed by compilers to calculate for each program point the variables that may be potentially read before their next write, that is, the variables that are ''live'' at the exit from each program point. Stated simply: a variable is live if it holds a value that may be needed in the future. Recently , various program analyses such as live variable analysis have been solved using Datalog. The Datalog specifications for such analyses are generally an order of magnitude shorter than their imperative counterparts (e.g. iterative analysis), and are at least as efficient. == Example == The set of live variables at line L3 is because both are used in the addition, and thereby the call to f and assignment to a . But the set of live variables at line L1 isonly since variable c is updated in L2. The value of variable a is never used. Note that f may be stateful, so the never-live assignment to a can be eliminated, but there is insufficient information to rule on the entirety of L3 .抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Live variable analysis」の詳細全文を読む スポンサード リンク
|